package com.yanjingzheng.entity;

/**
 * @Author Yenchingcheng
 * @Date 2023/9/11 14:45
 * @Description 二进制观察类
 **/
public class BinaryObserver extends Observer{

    public BinaryObserver(Subject subject){
        this.subject = subject;
        this.subject.attach(this);
    }

    @Override
    public void update() {
        System.out.println("Binary String: " + Integer.toBinaryString(subject.getState()));
    }
}
